package com.qunduikj.sjb.sdk.model.enums;

/**
 * 走镖消息类型
 *
 * @author June @http://litesuits.com
 * @date 2015-09-06
 */
public enum MessagesType {
    // 1好友消息,2运营消息，3等级消息，4积分消息，5提醒消息
    FriendMessage(1, "好友消息"), OperateMessage(2, "运营消息"), GradeMessage(3, "等级消息"), IntegralMessage(4, "积分消息"), RemindMessage(5, "提醒消息");
    //定义私有变量
    private int messageCode;
    private String messageType;

    MessagesType(int messageCode, String messageType) {
        this.messageCode = messageCode;
        this.messageType = messageType;
    }

    public int getMessageCode() {
        return messageCode;
    }

    public MessagesType setMessageCode(int messageCode) {
        this.messageCode = messageCode;
        return this;
    }

    public String getMessageType() {
        return messageType;
    }

    public MessagesType setMessageType(String messageType) {
        this.messageType = messageType;
        return this;
    }

    @Override
    public String toString() {
        return "MessagesType{" +
                "messageCode=" + messageCode +
                ", messageType='" + messageType + '\'' +
                '}';
    }

    public static String getMessageType(int mesageCode) {
        MessagesType messagesTypes[] = MessagesType.values();
        for (int i = 0; i < messagesTypes.length; i++) {
            MessagesType mt = messagesTypes[i];
            if (mt.getMessageCode() == mesageCode) {
                return mt.getMessageType();
            }
        }
        return "";
    }
}
